<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // js 是编程语言有很强的逻辑性在里面：实现这个要求的思路，先怎么做后怎么做
        // 1.我们需要一个临时变量帮我们；
        // 2.把apple1 给我们的临时变量temp
        // 3.把apple2 给我们的临时变量temp
        // 4.把临时变量里面的值给 apple2
        var temp;
        var apple1 = '红苹果',apple2 = '青苹果';
        temp = apple1;
        apple1 = apple2;
        apple2 = temp;
        console.log(apple1);
        console.log(apple2);
    </script>
</head>
<body>
    
</body>
</html>